#include "changenickname.h"
#include "ui_changenickname.h"

ChangeNickName::ChangeNickName(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ChangeNickName)
{
    ui->setupUi(this);
}

ChangeNickName::~ChangeNickName()
{
    delete ui;
}

//接收信号显示修改昵称界面
void ChangeNickName::recShowChangeNickName()
{
    this->show();
}

void ChangeNickName::on_back_clicked()
{
    emit this->sendShowMe(); //发送信号显示我界面
    this->hide();
}

void ChangeNickName::on_change_clicked()
{
    this->newNickName = ui->newNickName->text();//接收文本框中的内容

    emit this->sendNewNickNameToMe();
    QMessageBox::information(NULL, GAME_NAME, "修改昵称成功！");
    emit this->sendShowMe(); //发送信号显示我界面
    this->hide();
}
